From: Paul Donald Date: Tue, 22 Oct 2024 20:33:00 +0000 (+0200) Subject: luci-base: allow terminal '.' in hostname checks X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=1f32729428b4a859399c03efd255d7ae61a7b2b8;p=project%2Fluci.git luci-base: allow terminal '.' in hostname checks allowed in hostnames to represent the root of the DNS hierarchy Signed-off-by: Paul Donald --- diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index 5719031cb7..87f5f4b42c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -394,7 +394,7 @@ var ValidatorFactory = baseclass.extend({ if (this.value.length <= 253) return this.assert( (this.value.match(/^[a-zA-Z0-9_]+$/) != null || - (this.value.match(/^[a-zA-Z0-9_][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$/) && + (this.value.match(/^[a-zA-Z0-9_][a-zA-Z0-9_\-.]*[a-zA-Z0-9]\.?$/) && this.value.match(/[^0-9.]/))) && (!strict || !this.value.match(/^_/)), _('valid hostname'));